#ifndef MONITOR_NEW_PARSER_SYSTEM_TOOL_PARSER_H_
#define MONITOR_NEW_PARSER_SYSTEM_TOOL_PARSER_H_

#include <string>

#include "parser_base.h"

namespace sysinfo {
namespace monitor {

class SystemToolParser : public ParserBase {
 public:
  SystemToolParser() = default;
  ~SystemToolParser() override = default;

  // 解析命令输出
  bool Parse(const std::string& command_name, 
             const std::string& output,
             SystemInfoProto* info) override;

 private:
  // 各种工具输出解析方法
  bool ParseMpstat(const std::string& output, SystemInfoProto* system_info_proto);
  bool ParsePidstat(const std::string& output, SystemInfoProto* system_info_proto);
  bool ParseOncputime(const std::string& output, SystemInfoProto* system_info_proto);
  bool ParseProfile(const std::string& output, SystemInfoProto* system_info_proto);
  bool ParseProfileBpfcc(const std::string& output, SystemInfoProto* system_info_proto);
  bool ParseMemstat(const std::string& output, SystemInfoProto* system_info_proto);
  bool ParseSar(const std::string& output, SystemInfoProto* system_info_proto);
  bool ParseTegrastats(const std::string& output, SystemInfoProto* system_info_proto);
  bool ParseEmcLog(const std::string& output, SystemInfoProto* system_info_proto);
  bool ParseIostat(const std::string& output, SystemInfoProto* system_info_proto);
  bool ParseOomkill(const std::string& output, SystemInfoProto* system_info_proto);
};

}  // namespace monitor
}  // namespace sysinfo

#endif  // MONITOR_NEW_PARSER_SYSTEM_TOOL_PARSER_H_